package com.DHH.Service.Identity.Impl;
import com.DHH.Entity.Identity.IdentityAuthenticationState;
import com.DHH.Mapper.Identity.IdentityAuthenticationStateMapper;
import com.DHH.Service.Identity.IIdentityAuthenticationStateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class IdentityAuthenticationStateServiceImpl implements IIdentityAuthenticationStateService{
	
	@Autowired
    private IdentityAuthenticationStateMapper identityAuthenticationStateMapper;
    
   @Override
   public IdentityAuthenticationState insertIdentityAuthenticationState(IdentityAuthenticationState identityAuthenticationState){
	   
        identityAuthenticationStateMapper.insertSelective(identityAuthenticationState);
	   return identityAuthenticationState;
	   
   };
   @Override
   public IdentityAuthenticationState updateIdentityAuthenticationState(IdentityAuthenticationState identityAuthenticationState){
	     identityAuthenticationStateMapper.updateByPrimaryKeySelective(identityAuthenticationState);
        return identityAuthenticationState;
   };
   @Override
   public IdentityAuthenticationState deleteIdentityAuthenticationState(IdentityAuthenticationState identityAuthenticationState){

	     identityAuthenticationStateMapper.delete(identityAuthenticationState);
        return identityAuthenticationState;
   };
    /**
     * 保存或更新操作，返回值为主表
     */
    public IdentityAuthenticationState saveOrUpdateIdentityAuthenticationState(IdentityAuthenticationState identityAuthenticationState){
        if(identityAuthenticationState.getId()==null)
        {
            identityAuthenticationStateMapper.insertSelective(identityAuthenticationState);
        }else{
            identityAuthenticationStateMapper.updateByPrimaryKeySelective(identityAuthenticationState);
        }
        return identityAuthenticationState;
    };
}
